<?php
require_once('../config.php');
$conn = mysqli_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname);

$user_name=$_GET["user_name"];
$ndate=date("Y-m-d",time());
$str = file_get_contents($_FILES['btn_file']['tmp_name']);
$nstr=explode("\r\n",$str);
for($i=0;$i<count($nstr);$i++){
//echo $nstr[$i]."<br>"; 
$sql = "INSERT INTO ph_upc(upccode,user_name,ndate)VALUES('".$nstr[$i]."','".$user_name."','".$ndate."')";
mysqli_query($conn,$sql);
}
echo "ok";
?>